<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/21 0021
 * Time: 16:41
 */
function sqlQuery($sql)
{
    //1.创建数据库的链接
    $connection = new mysqli("127.0.0.1", "root", "", "fsgouwu", 3306);
    //2.设置链接字符集
    mysqli_query($connection, "set names utf8");
    //3.准备sql语句 传入

    //4.执行sql语句获取结果
    $result = $connection->query($sql);
    //5.关闭数据
    $connection->close();
    //6.返回结果
    return $result;
}